﻿using Newtonsoft.Json;
using WMS.FC.Domain.ValueObject.System;

namespace WMS.FC.Domain.ValueObject.Menu
{
    /// <summary>
    /// 列配置VO
    /// </summary>
    public class ColumnVO : ValueObjectBase
    {
        /// <summary>
        /// 字段名
        /// </summary>
        [JsonProperty("field")]
        public string Field { get; set; } = string.Empty;

        /// <summary>
        /// 中文名称
        /// </summary>
        [JsonProperty("nameCN")]
        public string NameCN { get; set; } = string.Empty;

        /// <summary>
        /// 英文名称
        /// </summary>
        [JsonProperty("nameEN")]
        public string NameEN { get; set; } = string.Empty;

        /// <summary>
        /// 列宽
        /// </summary>
        [JsonProperty("width")]
        public string Width { get; set; } = "100px";

        /// <summary>
        /// 是否只读
        /// </summary>
        [JsonProperty("isReadonly")]
        public bool IsReadonly { get; set; }

        /// <summary>
        /// 是否隐藏
        /// </summary>
        [JsonProperty("isHidden")]
        public bool IsHidden { get; set; }

        /// <summary>
        /// 是否可查询
        /// </summary>
        [JsonProperty("isSearchable")]
        public bool IsSearchable { get; set; }

        /// <summary>
        /// 控件类型
        /// </summary>
        [JsonProperty("controlTypeCode")]
        public string ControlTypeCode { get; set; } = string.Empty;

        /// <summary>
        /// 数据源
        /// </summary>
        [JsonProperty("dataSource")]
        public string DataSource { get; set; } = string.Empty;

        /// <summary>
        /// 验证规则
        /// </summary>
        [JsonProperty("rules")]
        public List<ColumnRuleVO> Rules { get; set; } = new List<ColumnRuleVO>();
    }
}
